How to convert a dictionary into a string in Python using str()